# -*- coding=utf-8
from qcloud_cos import CosConfig
from qcloud_cos import CosS3Client

# SecretId:AKIDa2GYfaHk392hBUdfYTNQGxRiokU0JOGu
# SecretKey:T1OXqEHAsQGwRkrmU0KRL1udBWfkeQ5Z
secret_id = 'AKIDa2GYfaHk392hBUdfYTNQGxRiokU0JOGu'      # 替换为用户的 secretId
secret_key = 'T1OXqEHAsQGwRkrmU0KRL1udBWfkeQ5Z'      # 替换为用户的 secretKey
region = 'ap-shanghai'     # 替换为用户的 Region

config = CosConfig(Region=region, SecretId=secret_id, SecretKey=secret_key)
# 2. 获取客户端对象
client = CosS3Client(config)

# 创建桶
response = client.create_bucket(
    Bucket='test-122412121',
    ACL="public-read"  #  private  /  public-read / public-read-write
)